import java.util.*;

public class Player
{
    
    private int strength = 100;
    public Map<String, Thing> bag = new HashMap<>();

    public void step()
    {
        this.strength -= 10;
        System.out.println("你的体力值："+strength);
    }

   
    public void use(String thingName)
    {
       Thing thing = bag.get(thingName);
       if(thing != null){
             this.strength += thing.getEnergy();
             if(this.strength > 100){
                this.strength  = 100;
                }
             System.out.println(this.strength);           
             bag.remove(thingName);
       }else{
             System.out.println("no"); 
       }       
    }
    
    public void  pick(Thing thing){
         bag.put(thing.getName(),thing);
    }
    
    public void  hit(Thing thing){
         thing.getName();
    }
    
    public void over(){
         if(strength<=0){
              System.out.println("灰烬尽全力想迈出那一步，但却有了体力，最终倒在原地。");
              System.exit(1);
         }
    }
}